package com.logisticsinquiry.android.logic.dao

import androidx.room.*
import com.logisticsinquiry.android.logic.entity.User

@Dao
interface UserDao {

    @Insert
    fun insertUser(user: User): Long

    @Update
    fun updateUser(newUser:User)

    @Query("select * from User")
    fun loadAllUsers():List<User>

    @Query("select * from User where username = :username")
    fun loadUserByUsername(username:String):User

    @Delete
    fun deleteUser(user:User)
}